package phone.qyg.com.qyg.model;

import android.os.Parcel;
import android.os.Parcelable;

/**
 * 作者：lblbh on 2017/12/13 14:22
 * 邮箱：lanbuhan@163.com
 * 功能：课程回答 传递使用
 */

public class CourseInterTrans implements Parcelable {

//      “id”:1    //问题ID
//            “reply_user_id”：1//被回复者id（二级回复用）
//            “parent_id”:1 //被回复的回答id（二级回复用）


    public int id;
    public int hint;//内容提示语
    public int type;//1-课程 2-一级 3-二级
    public int parent_id;
    public int reply_user_id;
    public int ans_user_type;//二级回复使用


    public CourseInterTrans() {}

    /**
     * 课程/一级使用
     * @param id
     * @param type
     */
    public CourseInterTrans(int id,int type) {
        this.id = id;
        this.type = type;
    }

    /**
     * 二级回复使用
     * @param id
     * @param parent_id
     * @param reply_user_id
     * @param ans_user_type 消息类型
     * @param type
     */
    public CourseInterTrans(int id,int parent_id,int reply_user_id,int ans_user_type,int type) {
        this.id = id;
        this.parent_id = parent_id;
        this.reply_user_id = reply_user_id;
        this.ans_user_type = ans_user_type;
        this.type = type;
    }


    @SuppressWarnings("unchecked")
    public CourseInterTrans(Parcel in) {
        id = in.readInt();
        type = in.readInt();
        hint = in.readInt();
        parent_id = in.readInt();
        reply_user_id = in.readInt();
        ans_user_type = in.readInt();
    }

    @Override
    public int describeContents() {
        return 0;
    }

    @Override
    public void writeToParcel(Parcel dest, int flags) {
        dest.writeInt(id);
        dest.writeInt(type);
        dest.writeInt(hint);
        dest.writeInt(parent_id);
        dest.writeInt(reply_user_id);
        dest.writeInt(ans_user_type);
    }


    public static final Creator<CourseInterTrans> CREATOR = new Creator<CourseInterTrans>() {
        @Override
        public CourseInterTrans[] newArray(int size) {
            return new CourseInterTrans[size];
        }

        @Override
        public CourseInterTrans createFromParcel(Parcel in) {
            return new CourseInterTrans(in);
        }
    };


}
